package com.chukun.interview.feature.inf.base;

import com.chukun.interview.feature.inf.base.SealedShape;

/**
 * 继承封闭类的长方形类
 * <p>
 * non-sealed： PermitsRectangle是一个解封类
 */
public non-sealed class PermitsRectangle extends SealedShape {

    public final double length;
    public final double width;

    public PermitsRectangle(String id, double length, double width) {
        super(id);
        this.length = length;
        this.width = width;
    }

    @Override
    public double area() {
        return length * width;
    }
}
